package com.xuetang9.t9.hotel.services.impl;

import com.xuetang9.t9.hotel.beans.RolePermission;
import com.xuetang9.t9.hotel.mapper.IPositionMapper;
import com.xuetang9.t9.hotel.services.IPositionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName PositionService
 * @Description TODO
 * @Author qin
 * @Date 2020/3/2 20:15
 * @Version 1.0
 **/
@Service
public class PositionService implements IPositionService {
    @Autowired
    private IPositionMapper positionMapper;

    @Override
    public List<RolePermission> queryRoleList() {
        return positionMapper.queryRoleList();
    }

    @Override
    public boolean insertRole(RolePermission rolePermission) {
        return positionMapper.insertRole(rolePermission.getName(),rolePermission.getDisplayname(),rolePermission.getRequrl(),rolePermission.getDescription())>0;
    }

    @Override
    public boolean updateRole(RolePermission rolePermission) {
        return positionMapper.updateRole(rolePermission.getId(),rolePermission.getName(),rolePermission.getDisplayname(),rolePermission.getRequrl(),rolePermission.getDescription())>0;
    }

    @Override
    public boolean deleteRole(int id) {
        return positionMapper.deleteRole(id)>0;
    }

    @Override
    public RolePermission queryOne(Integer id) {
        return positionMapper.queryOne(id);
    }

    @Override
    public List<RolePermission> queryTankList() {
        return positionMapper.queryTankList();
    }

    @Override
    public List<RolePermission> queryName(String name) {
        return positionMapper.queryByName(name);
    }
}
